<template>
<view>
<view class="body">
  <image src="http://imgbdb3.bendibao.com/xcxbdb/file/20213/10/20210310100053_99749.jpeg" class="header" alt></image>
  <choose-city @chooseCity="chooseCity">
    <view class="/news/hesuanjiance/city_didian.php">
      <view class="city-name">{{city}}</view>
      <image src="/static/images/dwicon.png" class="city-icon" alt></image>
    </view>
  </choose-city>
  <view class="main-content">
    <view class="card city-local" v-if="isCity">
      <view class="card-title">
        <view class="title-left">
          <view class="title-text p">本市疫情状况</view>
          <view class="time p">2020-10-09 08时更新</view>
        </view>
        <view class="title-right">
          <a class="show-all" @tap="cut">
            查看全国
            <image class="show-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228135851_17284.png" alt>
            </image>
          </a>
        </view>
      </view>
      <view class="data">
        <view class="data-item data-item-1">
          <view class="num">32</view>
          <view class="desc">确诊</view>
        </view>

        <view class="data-item data-item-3">
          <view class="num">32</view>
          <view class="desc">治愈</view>
        </view>
        <view class="data-item data-item-4">
          <view class="num">0</view>
          <view class="desc">死亡</view>
        </view>
      </view>
      <view class="control flex">
        <view class="all-num">
          <image src="/static/images/topical/xia.png" class="arrow-bottom"></image>
        </view>
      </view>
    </view>
    <view class="card city-all" v-else>
      <view class="card-title">
        <view class="title-left">
          <view class="title-text p">本市疫情状况</view>
          <view class="time p">2020-10-09 08时更新</view>
        </view>
        <view class="title-right">
          <a class="show-all" @tap="cut">
             查看本市
            <image class="show-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228135851_17284.png" alt>
            </image>
          </a>
        </view>
      </view>
      <view class="data">
        <view class="data-item">
          <view class="num">32</view>
          <view class="desc">确诊</view>
        </view>
        <view class="data-item">
          <view class="num">32</view>
          <view class="desc">疑似</view>
        </view>
        <view class="data-item">
          <view class="num">32</view>
          <view class="desc">治愈</view>
        </view>
        <view class="data-item">
          <view class="num">0</view>
          <view class="desc">死亡</view>
        </view>
      </view>
      <view class="control flex">
        <view class="all-num">
          <image src="/static/images/topical/xia.png" class="arrow-bottom"></image>
        </view>
      </view>
    </view>
    <view class="tab-bar">
      <view class="bar-title ul">
        <view class="title-name click li">
          重要信息
        </view>
        <view class="title-name li">
          隔离资讯
        </view>
        <view class="title-name li">
          核酸资讯
        </view>
        <view class="title-name li">
          返乡资讯
        </view>
      </view>
      <view class="tab-content" style="display: block;">
        <view class="ul">
          <view class="li">
            <a href="http://m.bd.bendibao.com/news/7566.shtm">
              <view class="imp">
                <view class="imp-title">
                  <image class="imp-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228092343_12218.png?1">
                  </image>
                  <text class="imp-name">保定肺炎疫情最新消息（持续更新）</text>
                </view>
                <view class="imp-content">
                  2021-01-27 15:43
                </view>
              </view>
            </a></view>
          <view class="li">
            <a href="http://m.bd.bendibao.com/news/8628.shtm">
              <view class="imp">
                <view class="imp-title">
                  <image class="imp-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228092343_12218.png?1">
                  </image>
                  <text class="imp-name">河北新冠肺炎疫情最新消息（每日更新）</text>
                </view>
                <view class="imp-content">
                  2021-01-16 20:45
                </view>
              </view>
            </a></view>
          <view class="li">
            <a href="http://m.bd.bendibao.com/news/9412.shtm">
              <view class="imp">
                <view class="imp-title">
                  <image class="imp-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228092343_12218.png?1">
                  </image>
                  <text class="imp-name">全国疫情风险等级怎么查询（附全国疫情风险地区查询系统）</text>
                </view>
                <view class="imp-content">
                  2021-01-05 15:33
                </view>
              </view>
            </a></view>
          <view class="li">
            <a href="http://m.bd.bendibao.com/news/8076.shtm">
              <view class="imp">
                <view class="imp-title">
                  <image class="imp-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228092343_12218.png?1">
                  </image>
                  <text class="imp-name">河北中小学2020秋季开学时间</text>
                </view>
                <view class="imp-content">
                  2020-08-17 00:03
                </view>
              </view>
            </a></view>
          <view class="li">
            <a href="http://m.bd.bendibao.com/news/9392.shtm">
              <view class="imp">
                <view class="imp-title">
                  <image class="imp-icon" src="http://imgbdb3.bendibao.com/whbdb/20202/28/20200228092343_12218.png?1">
                  </image>
                  <text class="imp-name">全国肺炎疫情最新消息（持续更新）</text>
                </view>
                <view class="imp-content">
                  2020-08-11 09:54
                </view>
              </view>
            </a></view>
        </view>
        <view class="all">查看全部</view>
      </view>
    </view>
    <view class="special">
      <view class="card">
        <view class="sp-title">
          <image src="http://imgbdb3.bendibao.com/xcxbdb/file/20213/10/20210310140759_55569.jpeg" class="sp-title-img"></image>
          <text class="sp-title-span">防疫服务</text>
        </view>
        <view class="sp-con">
          <a v-for="(item, index) in 9" :key="index" href="/news/yqdengji/" class="sp-item">
            <image src="/static/pages/topicality/xinguanfeiyan/images/icon/fangyi/icon_5.png" class="sp-icon"></image>
            <text>疫情风险等级</text>
          </a>
        </view>
      </view>
    </view>
    <view class="swiper card">
      <view class="sp-title">
        <image src="http://imgbdb3.bendibao.com/xcxbdb/file/20213/10/20210310140759_55569.jpeg" class="sp-title-img"></image>
        <text class="sp-title-span">民生办事</text>
      </view>
      <view class="swiper-container">
        <view class="swiper-wrapper">
          <view class="swiper-slide">
            <view class="link-list"><a href="/news/zhuantihanjia/" class="link-item">
                <view>寒假时间</view>
              </a><a href="http://2019ncov.nosugartech.com/?scene=1&amp;clicktime=1580188447&amp;enterid=1580188447&amp;from=groupmessage&amp;isappinstalled=0" class="link-item">
                <view>同乘查询</view>
              </a><a href="http://m.bd.bendibao.com/news/7830.shtm" class="link-item">
                <view>口罩预约</view>
              </a><a href="http://m.bd.bendibao.com/news/7969.shtm" class="link-item">
                <view>公交恢复</view>
              </a><a href="http://m.bd.bendibao.com/news/8006.shtm" class="link-item">
                <view>健康申报</view>
              </a><a href="http://m.bd.bendibao.com/news/7612.shtm" class="link-item">
                <view>病例轨迹</view>
              </a></view>
          </view>
        </view>
        <a class="more-link"></a>
      </view>
    </view>
  </view>
</view>
<fixed-btn :city="city" :path="'/pages/index/index?city=' + city">
    <text slot="left">查看更多</text><text slot="right">本地资讯</text>
  </fixed-btn>
</view>
</template>

<script>
import chooseCity from "../../../component/chooseCity/chooseCity";
import fixedBtn from "../../../component/fixedBtn/fixedBtn";

export default {
  data() {
    return {
      city: '深圳',
      cityCode: 'sz',
      isCity: true
    };
  },

  components: {
    chooseCity,
    fixedBtn
  },
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {},

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  methods: {
    // 确定选择城市
    chooseCity(e) {
      this.setData({
        city: e.detail.city,
        cityCode: e.detail.cityCode
      });
    },

    cut() {
      this.setData({
        isCity: !this.isCity
      });
    }

  }
};
</script>
<style>
/* pages/topicality/xinguanfeiyan/xinguanfeiyan.wxss */
p {
  margin: 0;
}


.body {
  background-color: #ffffff;
  padding-bottom: 110rpx;
}
.main-content{
  position: relative;
  top: -40rpx;
}
/* 通用card */
.card {
	background-color: #ffffff;
	border-radius: 22.5rpx;
	padding: 30rpx 0rpx 20rpx 0;
	box-shadow: 0 0 30rpx #0000002b;
	margin: 0 26rpx;
	margin-bottom: 34rpx;
}
/* banner部分 */
.city {
  position: absolute;
  top: 26rpx;
  right: 25rpx;
  height: 50rpx;
  display: flex;
  padding: 0 15rpx;
  align-items: center;
  justify-content: center;
  line-height: 37.5rpx;
  border-radius: 187.5rpx;
  background-color: #ffffff;
}

.city-name {
  font-weight: 600;
  color: rgb(14, 20, 87);
  font-size: 26rpx;
}

.city-icon {
  width: 18rpx;
  height: 10rpx;
  margin-left: 10rpx;
}


.header {
  width: 100%;
  height: 300rpx;
  display: block;
}
/* 本市疫情情况 */
.card-title {
  height: 100rpx;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: 0 37.5rpx 12rpx 37.5rpx;
}
.title-left {
  display: flex;
  flex-direction: column;
}

.title-right {
  display: flex;
}
.show-all, .show-local {
  font-size: 22rpx;
  background-color: rgb(229, 239, 250);
  border-radius: 200rpx;
  padding: 14rpx 40rpx;
  color: rgb(83, 151, 211);
  display: flex;
  align-items: center;
}

.show-icon {
  width: 23rpx;
  height: 23rpx;
  margin-left: 7rpx;
  margin-top: 3rpx;
}

.time {
  font-size: 25rpx;
  color: rgba(184, 184, 184, 1);
  margin-top: 5rpx;
  font-weight: 300;
}

.all-num {
  height: 60rpx;
  width: 39%;
  margin: 0rpx auto;
  text-align: center;
  line-height: 60rpx;
  font-size: 26rpx;
  background: #F0EDF1;
  border-radius: 14rpx;
}

.desc {
  height: 51rpx;
  font-size: 26rpx;
  margin-bottom: 10rpx;
  color: #000000;
  border-radius: 10rpx;
  padding: 0rpx 18rpx;
  line-height: 51rpx;
}

.add-num {
  font-size: 25rpx;
  color: rgb(130, 128, 128);
}
.title-text {
	font-size: 34rpx;
	font-weight: bold;
	color: #000000;
}

.data {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0 37.5rpx;
}

.data-item {
	text-align: center;
}

.num {
	font-size: 50rpx;
	font-weight: 600;
	margin-bottom: 2rpx;
}

.city-local .desc {
	padding: 0rpx 45rpx;
}
.data-item:nth-child(1) .num,
.data-item:nth-child(1) .add-num span {
	color: rgb(254, 0, 0);
}

.data-item:nth-child(2) .num,
.data-item:nth-child(2) .add-num span {
	color: rgb(255, 102, 0);
}

.data-item:nth-child(3) .num,
.data-item:nth-child(3) .add-num span {
	color: rgb(8, 180, 42);
}

.data-item:nth-child(4) .num,
.data-item:nth-child(4) .add-num span {
	color: rgb(102, 102, 102);
}

.data-item-1 .num,
.data-item-1 .add-num span {
	color: rgb(254, 0, 0) !important;
}

.data-item-2 .num,
.data-item-2 .add-num span {
	color: rgb(255, 102, 0) !important;
}

.data-item-3 .num,
.data-item-3 .add-num span {
	color: rgb(8, 180, 42) !important;
}

.data-item-4 .num,
.data-item-4 .add-num span {
	color: rgb(102, 102, 102) !important;
}
.control-icon {
	width: 38rpx;
	margin-right: 170rpx;
	padding: 12.5rpx;
	height: 20rpx;
}

.control {
	display: flex;
	flex-direction: row-reverse;
	margin-left: 37.5rpx;
	margin-top: 27rpx;
	margin-right: 33rpx
}

.control a {
	float: right;
	font-size: 28rpx;
	color: #151e87;
}
/* tab */
.tab-bar {
	margin-top: 23.75rpx;
	margin: 0 26rpx;
	padding-bottom: 100rpx;
}

.imp {
	padding: 37.5rpx 10rpx;
	border-bottom: 2.25rpx solid rgb(238, 238, 238);
}

.arrow-bottom {
	width: 28rpx;
	height: 11rpx;
}

.tab-content .ul {
	padding-left: 0;
	margin: 0;
}

.tab-content .ul .li:last-child .imp {
	border: 0;
}

.imp-title {
	display: flex;
}

.imp-name {
	flex: 1;
	font-size: 31rpx;
	font-weight: 600;
	color: #000000;
}

.imp-content {
	font-size: 30rpx;
	color: rgb(102, 102, 102);
	margin-left: 5%;
	margin-top: 22.5rpx;
}
.bar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2.25rpx solid rgb(238, 238, 238);
  padding-left: 0;
  font-size: 32rpx;
  color: rgba(91, 91, 91, 1);
  margin: 0 0 0 0;
  padding-top: 4rpx;
}

.click {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(20, 20, 20, 1);
  line-height: 80rpx !important;
  font-weight: 600;
}

.click::after {
  content: '';
  display: block;
  margin: 0 auto;
  background: black;
  height: 8rpx;
  width: 60%;
  border-radius: 10rpx;
}
.imp-icon {
  width: 30rpx;
  height: 20rpx;
  margin-right: 20rpx;
  margin-top: 10rpx;
}
.all {
  height: 90rpx;
  width: 45%;
  margin: 30rpx auto;
  text-align: center;
  line-height: 90rpx;
  font-size: 30rpx;
  background: #F0EDF1;
  border-radius: 14rpx;
  color: #000000;
}

/* 带icon*/
.special {
	margin-top: 34rpx;
}

.sp-title {
	display: flex;
	align-items: center;
	padding-left: 22rpx;
	margin-bottom: 26rpx;
}

.sp-title-img {
	width: 18rpx;
	height: 26rpx;
	margin-right: 14rpx;
	vertical-align: middle;
}

.sp-title-span {
	font-size: 32rpx;
	color: #141414;
	font-weight: 500;
}

.sp-con {
	display: flex;
	flex-wrap: wrap;
	padding: 0 20rpx;
}

.sp-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 33%;
	margin-bottom: 44rpx;
	font-size: 26rpx;
	color: #545454;
	font-weight: 500;
}

.sp-item text {
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: center;
}

.sp-icon {
	width: 78rpx;
	height: 78rpx;
	margin-bottom: 14rpx;
}
/* 不带icon */
.swiper {
	margin-top: 50rpx;
	margin: 20rpx 26rpx;
}

.link-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.link-item a {
	color: #000000;
}

.link-item {
	overflow: hidden;
	width: 30% !important;
}
.link-item {
  width: 45%;
  height: 82.5rpx;
  margin: 10rpx 10rpx 10rpx 10rpx;
  border-radius: 56.25rpx;
  border: 0;
  color: rgb(113, 113, 113);
  font-size: 28rpx;
  line-height: 82.5rpx;
  text-align: center;
  background-color: rgb(238, 238, 238);
}
</style>